import cv2
import numpy as np
import matplotlib.pyplot as plt

img = cv2.imread(r'..\misc_pic\B.png')
#img = cv2.imread(r'E:\test.png',0)
img=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
img = cv2.GaussianBlur(img,(3,3),0)
canny = cv2.Canny(img, 30, 80)


plt.gray();
plt.imshow(canny,interpolation="nearest");
plt.show();

"""
cv2.imshow('Canny', canny)
cv2.waitKey(0)
cv2.destroyAllWindows()
"""